//@author A0096759E

package googlecal;

import storage.ScheduleEvent;

public class GoogleAPIResponse {
	
	private static final String STRING_NEW_LINE = "\n";
	
	private ScheduleEvent[] googleCalendarItems;

	/**
	 * Takes in a ScheduleEvent[] array and sets the field googleCalendarItems as the input
	 * @param googleCalendarItems - a ScheduleEvent[] array
	 */
	public void setGoogleCalendarItem(ScheduleEvent[] googleCalendarItems) {
		this.googleCalendarItems = googleCalendarItems;		
	}
	
	/**
	 * Returns the ScheduleEvent[] array in the googleCalendarItems field. Returns null if there
	 * is no ScheduleEvent[] array in the field.
	 * @return googleCalendarItems - a ScheduleEvent[] array
	 */
	public ScheduleEvent[] getGoogleCalendarItems() {
		return googleCalendarItems;
	}
	
	@Override
	public String toString() {
		StringBuilder stringToPrint = new StringBuilder();
		for (final ScheduleEvent googleCalendarItem : googleCalendarItems) {
		      stringToPrint.append(STRING_NEW_LINE).append(googleCalendarItem);
		}
		return stringToPrint.toString();
	}
		
}
